package com.dymedia.aibo.mvp.model.api;

import com.dymedia.aibo.mvp.model.Entity.ChannelHeader;
import com.dymedia.aibo.mvp.model.Entity.Channel;
import com.dymedia.aibo.mvp.model.Entity.Group;
import com.dymedia.aibo.mvp.model.Entity.GroupHeader;
import com.dymedia.aibo.mvp.model.Entity.VideoHeader;

import java.util.List;
import java.util.concurrent.TimeUnit;

import io.reactivex.Observable;
import io.rx_cache2.DynamicKey;
import io.rx_cache2.EvictProvider;
import io.rx_cache2.LifeCache;
import io.rx_cache2.Reply;

public interface Cache {
    @LifeCache(duration = 2, timeUnit = TimeUnit.HOURS)
    Observable<Reply<GroupHeader>> getGroups(Observable<GroupHeader> group, DynamicKey idLastUserQueried, EvictProvider evictProvider);

    @LifeCache(duration = 2, timeUnit = TimeUnit.HOURS)
    Observable<Reply<ChannelHeader>> getChannels(Observable<ChannelHeader> channel, DynamicKey idLastUserQueried, EvictProvider evictProvider);

    @LifeCache(duration = 2, timeUnit = TimeUnit.HOURS)
    Observable<Reply<VideoHeader>> getVideos(Observable<VideoHeader> video, DynamicKey idLastUserQueried, EvictProvider evictProvider);

    @LifeCache(duration = 2, timeUnit = TimeUnit.HOURS)
    Observable<List<Channel>> getChannelsList(Observable<List<Channel>> listObservable);
}